package com.sesame.controller;

import com.sesame.feign.FeignServiceTest;
import kim.sesame.common.web.controller.AbstractWebController;
import kim.sesame.common.result.ApiResult;
import lombok.extern.apachecommons.CommonsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 消费
 */
@CommonsLog
@RestController
@RequestMapping("/test")
public class TestController extends AbstractWebController {

    @Autowired
    FeignServiceTest feignServiceTest;

    /**
     * http://127.0.0.1:8094/test/getData?name=111&pwd=222
     *
     * @param name
     * @return
     */
    @RequestMapping("/getData")
    public ApiResult getData(String name, String pwd) {
        log.info(name);
        String str = feignServiceTest.test(name, pwd).getResult();
        System.out.println(str);
        return success(str);
    }
}
